package com.itheima.controller;

import com.itheima.common.R;
import com.itheima.entity.vo.dish.DishListVo;
import com.itheima.service.DishService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author huangzelnag
 * @create 2022-05-12
 */
@RestController
@RequestMapping("dish")
public class DishController {
    @Autowired
    DishService dishService;

    @GetMapping("list")
    public R getDishList(@RequestParam String categoryId,
                         @RequestParam String status){

      List<DishListVo> list=  dishService.getDishList(categoryId,status);
        return R.success(list);
    }
}
